home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 987 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.0 KB

  1. Path: news.eunet.fi!fipnet!kone!jsaarinen
  2. Newsgroups: comp.sys.amiga.programmer
  3. X-NewsReader: IntuiNews 1.2b (31.7.94)
  4. References: <38231915@kone.fipnet.fi> <4d6cpp$iu2@sunsystem5.informatik.tu-muenchen.de>
  5. From: "Jyrki Saarinen" <jsaarinen@kone.fipnet.fi>
  6. Date: Sat, 13 Jan 96 15:38:06 UT
  7. Comments: Illegal date header - new date added by quicknews
  8. X-Original-Date: Sat, 13 Jan 96 16:14:23 
  9. MIME-Version: 1.0
  10. Content-Type: text/plain; charset=iso-8859-1
  11. Content-Transfer-Encoding: binary
  12. Distribution: world
  13. Subject: Re: Demo/game to OS friendly part II
  14. Message-ID: <38232022@kone.fipnet.fi>
  15.  
  16.  
  17. > well seems that OS3 buffering works bets for both AGA and gfx-cards.
  18. > just blitterc2p to the aga screens and writepixelarray8 to the
  19. > gfx-screens.
  20.  
  21. WritePixelArray8() .. no way, just plain copying on ZII cards
  22. and straight drawing to the frame buffer of faster cards.
  23.  
  24. Btw, here is the next generation loop:
  25.  
  26. ;a0.l ptr to texture
  27. ;a1.l ptr to shading table
  28. ;a2.l g<<8
  29. ;a3.l gstep<<8
  30. ;a4.l ptr to chunky buffer
  31. ;d0.l vfrac,uint
  32. ;d1.l vstepfrac,ustepint
  33. ;d2.l ufrac,vint<<8
  34. ;d3.l ustepfrac,ustepint<<8
  35.  
  36.         REPT    4
  37.         move.l  a2,d4           ;g<<8, 2 cycles
  38.         move.l  d2,d5           ;u<<8, 2 cycles
  39.         move.b  d0,d5           ;+v, 2 cycles
  40.         move.b  (a0,d5.l),d4    ;g<<8,texel, 6 cycles
  41.         add.l   a3,a2           ;g+=gstep, 2 cycles
  42.         addx.l  d3,d2           ;v+=vstep, 2 cycles
  43.         addx.l  d1,d0           ;u+=ustep, 2 cycles
  44.         move.b  (a1,d4.l),(a4)+ ;write pixel, 10 cycles
  45.         ENDR
  46.  
  47. That is 28 cycles per pixel. 64k aligned would be:
  48.  
  49. ;a2.l g<<8
  50. ;a3.l gstep<<8
  51. ;a4.l ptr to chunky buffer
  52. ;d0.l vfrac,uint
  53. ;d1.l vstepfrac,ustepint
  54. ;d2.l ufrac,vint<<8
  55. ;d3.l ustepfrac,ustepint<<8
  56. ;d4.l ptr to shading table, 64k aligned
  57. ;d5.l ptr to texture, 64k aligned
  58.  
  59.         REPT    4
  60.         move.w  a2,d4           ;g<<8, 2 cycles
  61.         move.w  d2,d5           ;u<<8, 2 cycles
  62.         move.b  d0,d5           ;+v, 2 cycles
  63.         move.l  d5,a0           ;ptr to texel, 2 cycles
  64.         move.b  (a0),d4         ;fetch texel, 5 cycles
  65.         move.l  d4,a1           ;ptr to pixel, 2 cycles
  66.         add.l   a3,a2           ;g+=gstep, 2 cycles
  67.         addx.l  d3,d2           ;v+=vstep, 2 cycles
  68.         addx.l  d1,d0           ;u+=ustep, 2 cycles
  69.         move.b  (a1),(a4)+      ;write pixel, 7 cycles
  70.         ENDR
  71.  
  72. Hmm. That is 28 cycles per pixel also.. So, no use for
  73. 64k aligned textures execpt in plain tmapping, without
  74. shading, there one cycle can be gained. Also, the hassle
  75. with 64k aligned textures is a pain in the butt..
  76.  
  77. A shading table and shading is a must, nobody wants
  78. to see objects rotaing without shading or with 16 shades
  79. and one 16c texture.
  80.  
  81. I wonder would there be any differences on the 68040 with
  82. these loops..
  83.  
  84. Oh, the idea why I wrote those loops was the 16 bits fraction
  85. for v, too..! Looks much better!
  86.  
  87. The question is, how the first loop should be scheduled for
  88. the 68040 to go as fast as possible?
  89.  
  90. --                               _
  91. a Stellar programmer          _ //
  92. "Amiga - back for the future" \X/
  93.